/** @file actor.h
    @brief Header file for the actor ...

    @author Juan Pablo Carbajal
    
    @date 21. July, 2008
    
 */
#ifndef _ACTOR_H_
#define _ACTOR_H_


#include "dom/Sa2dDom.h"
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

#include "chipmunk/chipmunk.h"
#include "util.h"

// Structures

//Variables 
extern cpSpace *space;
extern cpBody *staticBody;
extern int ticks;
extern int** actorIndex;
extern cpFloat dt;

// Prototypes
extern void initActors(configurationfile* agents);
extern void ChargedBodyUpdatePosition(cpBody *, cpFloat);
extern void ChargedBodyUpdatePositionVerlet(cpBody *, cpFloat);
extern void ChargedBodyUpdateVelocity(cpBody *, cpVect, cpFloat, cpFloat);
extern void ChargedBodyUpdateVelocityVerlet(cpBody *, cpVect, cpFloat, cpFloat);
extern void LRangeForceApply(cpBody *, cpBody *);
extern void ExternalField(cpBody *,cpFloat);
extern void LoadActorKin(agentSet*, int);
extern void ReadKinFile(const char* data, int num, cpFloat* ang,
							cpFloat* w, cpVect* p, cpVect* v);
extern void WriteKinFile(FILE* data, int num, cpFloat* ang,
							cpFloat* w, cpVect* p, cpVect* v);
extern void convertKinematic(paramSet* kin, acKinematic* pAcKinematic);
// Force functions
extern void CoulombForce(ForceData* data);
extern void PerpMagDipoleForce(ForceData* data);
extern void	MagDipoleForce(ForceData* data);
extern void	MagDipoleTorque(ForceData* data);
extern void FillForceData(Sing* source, int i, Sing* obs,int j, ForceData* data);

// Behavior functions
extern void vibMotor(BehavData* data);
#endif
